/*
 * Copyright (c) 2025 Industrial Software Feature Database
 */
package com.comac.ins.isfd.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.comac.ins.isfd.domain.IsfdDatabaseTypeManagement;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;


/**
 * 要素库类型管理视图对象 isfd_database_type_management
 *
 * @author Lion Li
 * @date 2025-02-27
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = IsfdDatabaseTypeManagement.class)
public class IsfdDatabaseTypeManagementVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @ExcelProperty(value = "主键")
    private Long id;

    /**
     * 父级别id
     */
    @ExcelProperty(value = "父级别id")
    private Long parentId;

    /**
     * 顶层id
     */
    @ExcelProperty(value = "顶层id")
    private Long topId;

    /**
     * 要素数据库名称，材料库、算法库、参数库等等
     */
    @ExcelProperty(value = "要素数据库名称，材料库、算法库、参数库等等")
    private String databaseName;

    /**
     * 所属所属父级库名称
     */
    private String parentDatabaseName;

    /**
     * 层级
     */
    @ExcelProperty(value = "层级")
    private Long level;

    /**
     * 创建日期
     */
    private Date createTime;

    /**
     * 描述
     */
    @ExcelProperty(value = "描述")
    private String description;

    /**
     * 子集合
     */
    private List<IsfdDatabaseTypeManagementVo> children = new ArrayList<>();


    /**
     * 子集添加集合
     */
    public void addChild(IsfdDatabaseTypeManagementVo child) {
        this.children.add(child);
    }
}
